#ifndef mgr_game_physics_h
#define mgr_game_physics_h

#import "head.h"

class CMgrGamePhysics : public b2ContactListener
{
public:
	b2World *world;
	float ratio; /*Box2D和屏幕单位的比率*/

private:
	static CMgrGamePhysics *instance;

public:
	static void InitInstance(void);
	static void FreeInstance(void);
	static CMgrGamePhysics *Instance(void);

	b2Vec2 GetBodyPos(b2Body *Body);
	float GetBodyAngle(b2Body *Body);

	static b2World *World(void);
	static float Ratio(void);

	void Update(void);

	void BeginContact(b2Contact *Contact);
	void EndContact(b2Contact *Contact);

protected:
	CMgrGamePhysics(void);
	~CMgrGamePhysics(void);
};

#endif